<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目统计管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.css" rel="stylesheet">
    <style>
        .card {
            margin-bottom: 20px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        .status-badge {
            padding: 5px 10px;
            border-radius: 20px;
            font-size: 0.8rem;
        }
        .version-history {
            max-height: 300px;
            overflow-y: auto;
        }
        .nav-tabs .nav-link.active {
            font-weight: bold;
            border-bottom: 3px solid #0d6efd;
        }
    </style>
</head>
<body>
    <div class="container-fluid py-4">
        <h1 class="mb-4">项目统计概览</h1>
        
        <!-- 项目数据总览 -->
        <div class="row">
            <div class="col-md-3">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">项目总数</h5>
                        <h2 class="text-primary">42</h2>
                        <p class="text-muted">较上月增长 12%</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">进行中项目</h5>
                        <h2 class="text-warning">18</h2>
                        <p class="text-muted">占比 42.8%</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">已完成项目</h5>
                        <h2 class="text-success">22</h2>
                        <p class="text-muted">占比 52.4%</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">延期项目</h5>
                        <h2 class="text-danger">2</h2>
                        <p class="text-muted">占比 4.8%</p>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 项目状态统计图表 -->
        <div class="row mt-4">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">
                        <h5>项目状态分布</h5>
                    </div>
                    <div class="card-body">
                        <canvas id="statusChart" height="250"></canvas>
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="card">
                    <div class="card-header">
                        <h5>流程完成情况</h5>
                    </div>
                    <div class="card-body">
                        <canvas id="processChart" height="250"></canvas>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 流程文件版本控制 -->
        <div class="row mt-4">
            <div class="col-12">
                <div class="card">
                    <div class="card-header">
                        <h5>流程文件更新列表</h5>
                    </div>
                    <div class="card-body">
                        <ul class="nav nav-tabs" id="processTabs" role="tablist">
                            <li class="nav-item" role="presentation">
                                <button class="nav-link active" id="process1-tab" data-bs-toggle="tab" data-bs-target="#process1" type="button" role="tab">1. 标准立项</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process2-tab" data-bs-toggle="tab" data-bs-target="#process2" type="button" role="tab">2. 标准研制</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process3-tab" data-bs-toggle="tab" data-bs-target="#process3" type="button" role="tab">3. 会议纪要</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process4-tab" data-bs-toggle="tab" data-bs-target="#process4" type="button" role="tab">4. 征求意见</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process5-tab" data-bs-toggle="tab" data-bs-target="#process5" type="button" role="tab">5. 标准审查</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process6-tab" data-bs-toggle="tab" data-bs-target="#process6" type="button" role="tab">6. 评审单</button>
                            </li>
                            <li class="nav-item" role="presentation">
                                <button class="nav-link" id="process7-tab" data-bs-toggle="tab" data-bs-target="#process7" type="button" role="tab">7. 公告</button>
                            </li>
                        </ul>
                        <div class="tab-content p-3 border border-top-0 rounded-bottom" id="processTabsContent">
                            <!-- 每个流程的版本控制内容 -->
                            <div class="tab-pane fade show active" id="process1" role="tabpanel">
                                <div class="row">
                                    <div class="col-md-12">
                                        <h6>最新版本文件</h6>
                                        <div class="list-group">
                                            <a href="javascript:;" class="list-group-item list-group-item-action active" >
                                                <div class="d-flex w-100 justify-content-between">
                                                    <h6 class="mb-1">a. 建议书 </h6>
                                                    <small class="text-success">v2.1.3</small>
                                                </div>
                                                <p class="mb-1">最后更新: 2025-01-01 14:30</p>
                                                <small>更新人: xxx</small>
                                            </a>
                                            <a href="javascript:;" class="list-group-item list-group-item-action">
                                                <div class="d-flex w-100 justify-content-between">
                                                    <h6 class="mb-1">计划通知函</h6>
                                                    <small class="text-success">v1.0.8</small>
                                                </div>
                                                <p class="mb-1">最后更新: 2023-11-10 09:45</p>
                                                <small>更新人: xxx</small>
                                            </a>
                                            <a href="javascript:;" class="list-group-item list-group-item-action">
                                                <div class="d-flex w-100 justify-content-between">
                                                    <h6 class="mb-1">立项专家审议表</h6>
                                                    <small class="text-success">v1.0.8</small>
                                                </div>
                                                <p class="mb-1">最后更新: 2023-11-10 09:45</p>
                                                <small>更新人: xxx</small>
                                            </a>
                                        </div>
                                    </div>
                                    <div class="col-md-6" style="display: none;" >
                                        <h6>版本历史</h6>
                                        <div class="version-history">
                                            <table class="table table-sm">
                                                <thead>
                                                    <tr>
                                                        <th>文件名</th>
                                                        <th>版本</th>
                                                        <th>日期</th>
                                                        <th>操作</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <tr>
                                                        <td>需求规格说明书</td>
                                                        <td>v2.1.3</td>
                                                        <td>2023-11-15</td>
                                                        <td><button class="btn btn-sm btn-outline-primary">查看</button></td>
                                                    </tr>
                                                    <tr>
                                                        <td>需求规格说明书</td>
                                                        <td>v2.1.2</td>
                                                        <td>2023-11-10</td>
                                                        <td><button class="btn btn-sm btn-outline-primary">查看</button></td>
                                                    </tr>
                                                    <tr>
                                                        <td>用户调研报告</td>
                                                        <td>v1.0.8</td>
                                                        <td>2023-11-10</td>
                                                        <td><button class="btn btn-sm btn-outline-primary">查看</button></td>
                                                    </tr>
                                                    <!-- 更多历史版本 -->
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <!-- 其他流程的tab-pane内容类似，这里省略 -->
                            <div class="tab-pane fade" id="process2" role="tabpanel">
                                <!-- 设计流程的文件版本内容 -->
                            </div>
                            <!-- 其他流程... -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.1/dist/chart.min.js"></script>
    <script>
        // 项目状态图表
        const statusCtx = document.getElementById('statusChart').getContext('2d');
        const statusChart = new Chart(statusCtx, {
            type: 'bar',
            data: {
                labels: ['进行中', '已完成', '延期', '未开始', '暂停'],
                datasets: [{
                    label: '项目数量',
                    data: [18, 22, 2, 5, 1],
                    backgroundColor: [
                        'rgba(255, 193, 7, 0.7)',
                        'rgba(25, 135, 84, 0.7)',
                        'rgba(220, 53, 69, 0.7)',
                        'rgba(108, 117, 125, 0.7)',
                        'rgba(13, 110, 253, 0.7)'
                    ],
                    borderColor: [
                        'rgba(255, 193, 7, 1)',
                        'rgba(25, 135, 84, 1)',
                        'rgba(220, 53, 69, 1)',
                        'rgba(108, 117, 125, 1)',
                        'rgba(13, 110, 253, 1)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true
                    }
                }
            }
        });

        // 流程完成情况图表
        const processCtx = document.getElementById('processChart').getContext('2d');
        const processChart = new Chart(processCtx, {
            type: 'doughnut',
            data: {
                labels: ['需求分析', '设计', '开发', '测试', '部署', '验收', '维护'],
                datasets: [{
                    data: [95, 85, 70, 60, 40, 30, 15],
                    backgroundColor: [
                        'rgba(255, 99, 132, 0.7)',
                        'rgba(54, 162, 235, 0.7)',
                        'rgba(255, 206, 86, 0.7)',
                        'rgba(75, 192, 192, 0.7)',
                        'rgba(153, 102, 255, 0.7)',
                        'rgba(255, 159, 64, 0.7)',
                        'rgba(199, 199, 199, 0.7)'
                    ],
                    borderWidth: 1
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'right'
                    }
                }
            }
        });
    </script>
</body>
</html>